#!/bin/bash
echo "Building AI Chat Window..."
echo

WXWIN="/d/vc/wxWidgets-3.2.7"

# 编译聊天窗口
g++ -std=c++11 -O2 -Wall -Wextra \
    -I"$WXWIN/include" \
    -I"$WXWIN/lib/wx/include/msw-unicode-3.2" \
    -D__WXMSW__ -D_UNICODE -DUNICODE \
    src/ai_chat_frame.cpp \
    -L"$WXWIN/lib" \
    -lwxmsw32u_core_gcc_custom -lwxbase32u_gcc_custom \
    -lwxmsw32u_adv_gcc_custom \
    -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 \
    -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid \
    -lcomctl32 -lrpcrt4 -loleacc -luxtheme \
    -o ai_chat_window.exe

if [[ $? -eq 0 ]]; then
    echo "✅ Chat window compiled successfully!"
    echo "Executable: ai_chat_window.exe"
    
    # 设置 PATH 并测试
    export PATH="$WXWIN/lib:$PATH"
    echo "🚀 You can now run: ./ai_chat_window.exe"
else
    echo "❌ Chat window compilation failed"
fi
